package com.jswlw.common;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * 自定义序列化mapper
 *
 * @author nature
 * @create 2017-10-30 13:45
 */
public class CustomObjectMapper extends ObjectMapper {

	private static final long serialVersionUID = 1683531771040674386L;

	public CustomObjectMapper() {
		super();
		SimpleModule simpleModule = new SimpleModule();
		simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
		simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
		registerModule(simpleModule);

	}
}